package test;

import java.util.Collection;

import org.junit.Test;

import com.crud.bean.Employee;
import com.crud.dao.EmployeeDao;

public class test {

	@Test
	public void teset1() {
		
		WebResponse wr = new WebResponse();
		System.out.println(wr.getData());
		wr.getData().add("HaHa");
		System.out.println(wr);
		wr.getData().forEach((data)
				-> {
					data = "测试1";
				});
		System.out.println(wr);
	}
	
	@Test
	public void test2() {

		EmployeeDao employeeDao = new EmployeeDao();
		Collection<Employee> emps = employeeDao.getAllEmployee();
		
		emps.forEach((emp) 
				-> {
					System.out.println(emp);
					System.out.println(emp.hashCode());
				});
		
		emps.forEach((emp) 
				-> {
					emp.getDepartment().setDepartmentName("这个是用来测试的");
					System.out.println(emp.getDepartment().hashCode());;
				});
		emps.forEach((emp) 
				-> {
					System.out.println(emp);
					System.out.println(emp.getDepartment().hashCode());
				});
		
	}

}
